import math
# 2.6.1 逻辑运算和移位运算
'''
print(0b00000101 ^ 0b00000100)
print(bin(0b00000101 ^ 0b00000100))
print(0b00111100 >> 2)
'''
# 2.6.2 控制结构
'''
water_temp = 141
if (water_temp > 140) :
    print('Bath water too hot!')

n = 0
while ( n < 10 ):
    print(n)
    n = n + 1

sideA = 3.0
sideB = 4.0
hypotenuse = math.sqrt(sideA**2 + sideB**2)
print(hypotenuse)
print(math.pi)
'''

# 2.6.3 输入和输出
'''
echo = input('Please input a string to echo\n')
print(echo*3)
sideA = float(input('Please input sideA\n'))
sideB = float(input('Please input sideB\n'))
hypotenuse = math.sqrt(sideA**2 + sideB**2)
print(hypotenuse)
'''

#2.6.4 马拉松脚本

def total_seconds(min,sec):
    return 60*min + sec

def speed(sec):
    return 3600/ sec


pace_minute = int(input('input pace minute'))
pace_second = int(input('input pace second'))
miles = int(input('input miles'))

mph = speed(total_seconds(pace_minute,pace_second))
print('your speed is ')
print(mph)

total = miles * total_seconds(pace_minute,pace_second)
elapsed_minutes = total // 60
elapsed_seconds = total % 60

print('your total elapsed time is ')
print(elapsed_minutes)
print(elapsed_seconds)
